<%@ page import="org.bjou.UserBaseinfo" %>
<%@ page import="org.bjou.Title" %>
<!doctype html>
<html>
	<head>
		<meta name="layout" content="pertho">
		<g:set var="entityName" value="${message(code: 'userBaseinfo.label', default: 'UserBaseinfo')}" />
		<title><g:message code="default.edit.label" args="[entityName]" /></title>
                
              <script>
    $(document).ready(function() {
          $("#tabs").tabs();
          $("#birthday").datepicker();
  });
 </script>     

	</head>
	<body>
		<div class="container">
    <div class="row">
      <div class="twelve columns">
        <g:form method="post" enctype="multipart/form-data" >
        <div id="tabs">
          
            <ul>
                                    <li><a href="#tabs-1">
                                        个人信息 </a>
                                    </li>
                                    <li><a href="#tabs-2">
                                        最高学历 </a>
                                    </li>
                                    <li><a href="#tabs-3">
                                        工作履历 </a>
                                    </li>
                                   <li><a href="#tabs-4">
                                        附件 </a>
                                    </li>
                                  </ul>
            
            
               <!-- 个人信息开始 -->
                                <div id="tabs-1">
                                  
                                  
                              
		  <!-- start-->
		<div id="edit-userBaseinfo" class="content scaffold-edit" role="main">
			<g:if test="${flash.message}">
			<div class="message" role="status">${flash.message}</div>
			</g:if>
			<g:hasErrors bean="${userBaseinfoInstance}">
			<ul class="errors" role="alert">
				<g:eachError bean="${userBaseinfoInstance}" var="error">
				<li <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>><g:message error="${error}"/></li>
				</g:eachError>
			</ul>
			</g:hasErrors>
			
				<g:hiddenField name="id" value="${userBaseinfoInstance?.id}" />
				<g:hiddenField name="version" value="${userBaseinfoInstance?.version}" />
				<fieldset class="form">
			
                                  <div class="fieldcontain ${hasErrors(bean: userBaseinfoInstance, field: 'fullname', 'error')} ">
	<label for="fullname">
		<g:message code="userBaseinfo.fullname.label" default="Fullname" />
		
	</label>
	<g:textField name="fullname" value="${userBaseinfoInstance?.fullname}"/>
</div>
                                  
                                  
                                     <div class="fieldcontain ${hasErrors(bean: userBaseinfoInstance, field: 'fullname', 'error')} ">
	<label for="fullname">
		头像
		
	</label>
	<input id="avatar" name="avatar" type="file" />
</div>
                                  
                                  

<div class="fieldcontain ${hasErrors(bean: userBaseinfoInstance, field: 'gentle', 'error')} ">
	<label for="gentle">
		<g:message code="userBaseinfo.gentle.label" default="Gentle" />
		
	</label>
    <g:select optionKey="key" optionValue="value" noSelection="['':'-请选择-']" 
                         from="${['男':'男','女':'女']}"
                         name='gentle' value="${userBaseinfoInstance?.gentle}" >
               </g:select>
	
</div>

<div class="fieldcontain ${hasErrors(bean: userBaseinfoInstance, field: 'tel', 'error')} ">
	<label for="tel">
		<g:message code="userBaseinfo.tel.label" default="Tel" />
		
	</label>
	<g:textField name="tel" value="${userBaseinfoInstance?.tel}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: userBaseinfoInstance, field: 'idCard', 'error')} ">
	<label for="idCard">
		<g:message code="userBaseinfo.idCard.label" default="Id Card" />
		
	</label>
	<g:textField name="idCard" value="${userBaseinfoInstance?.idCard}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: userBaseinfoInstance, field: 'birthday', 'error')} ">
	<label for="birthday">
		<g:message code="userBaseinfo.birthday.label" default="Birthday" />
		
	</label>
	<g:textField name="birthday" value="${userBaseinfoInstance?.birthday}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: userBaseinfoInstance, field: 'mobile', 'error')} ">
	<label for="mobile">
		<g:message code="userBaseinfo.mobile.label" default="Mobile" />
		
	</label>
	<g:textField name="mobile" value="${userBaseinfoInstance?.mobile}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: userBaseinfoInstance, field: 'email', 'error')} ">
	<label for="email">
		<g:message code="userBaseinfo.email.label" default="Email" />
		
	</label>
	<g:textField name="email" value="${userBaseinfoInstance?.email}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: userBaseinfoInstance, field: 'title', 'error')} ">
	<label for="title">
		<g:message code="userBaseinfo.title.label" default="Title" />
		
	</label>
	<g:select id="title" name="title" from="${org.bjou.Title.where {}.projections{distinct 'title'}.list()}" 
                          value="${userBaseinfoInstance?.title}" onchange="${remoteFunction(controller:'UserBaseinfo', action:'listByTitle', params:'\'title=\'+this.value', update:'userlist')}" 
                          class="many-to-one" noSelection="['': '请选择']"/>
        
</div>

<div class="fieldcontain ${hasErrors(bean: userBaseinfoInstance, field: 'proTitle', 'error')} ">
 
     <label for="proTitle">
		<g:message code="userBaseinfo.proTitle.label" default="Pro Title" />
	</label>
    <span  id="userlist">
   <select><option>${userBaseinfoInstance?.proTitle}</option></select>
   </span>

  
	
</div>

<div class="fieldcontain ${hasErrors(bean: userBaseinfoInstance, field: 'companyName', 'error')} ">
	<label for="companyName">
		<g:message code="userBaseinfo.companyName.label" default="Company Name" />
		
	</label>
	<g:textField name="companyName" value="${userBaseinfoInstance?.companyName}"/>
</div>




				</fieldset>
				
			 <div class="box_c">
          
         
          <fieldset class="buttons">
					<g:actionSubmit class="gh_button" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" />
                                        <!--
					<g:actionSubmit class="gh_button icon danger" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" formnovalidate="" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" />
                                           -->
                                        </fieldset>
          
          
          </div>
              <!-- end -->
            </div>
                                  
          
        </div>
                <!-- 个人信息结束 -->
                 <!-- 最高学历开始 -->
             <div id="tabs-2">
               <div id="edit-userBaseinfo" class="content scaffold-edit" role="main">
            <div class="fieldcontain ${hasErrors(bean: userBaseinfoInstance, field: 'beginYear', 'error')} ">
	<label for="beginYear">
		<g:message code="userBaseinfo.beginYear.label" default="Begin Year" />
		
	</label>
	
        
         <g:select  from="${yearList}"
                         name='beginYear' value="${userBaseinfoInstance?.beginYear}" >
               </g:select>
</div>

<div class="fieldcontain ${hasErrors(bean: userBaseinfoInstance, field: 'beginMonth', 'error')} ">
	<label for="beginMonth">
		<g:message code="userBaseinfo.beginMonth.label" default="Begin Month" />
		
	</label>
   <g:select  from="${monthList}"
                         name='beginMonth' value="${userBaseinfoInstance?.beginMonth}" >
               </g:select>
	
</div>

<div class="fieldcontain ${hasErrors(bean: userBaseinfoInstance, field: 'endYear', 'error')} ">
	<label for="endYear">
		<g:message code="userBaseinfo.endYear.label" default="End Year" />
		
	</label>
	<g:select  from="${yearList}"
                         name='endYear' value="${userBaseinfoInstance?.endYear}">
               </g:select>
</div>

<div class="fieldcontain ${hasErrors(bean: userBaseinfoInstance, field: 'endMonth', 'error')} ">
	<label for="endMonth">
		<g:message code="userBaseinfo.endMonth.label" default="End Month" />
		
	</label>
	   <g:select  from="${monthList}"
                         name='endMonth' value="${userBaseinfoInstance?.endMonth}" >
               </g:select>
</div>

<div class="fieldcontain ${hasErrors(bean: userBaseinfoInstance, field: 'school', 'error')} ">
	<label for="school">
		<g:message code="userBaseinfo.school.label" default="School" />
		
	</label>
	<g:textField name="school" value="${userBaseinfoInstance?.school}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: userBaseinfoInstance, field: 'degree', 'error')} ">
	<label for="degree">
		<g:message code="userBaseinfo.degree.label" default="Degree" />
		
	</label>
	  <g:select optionKey="key" optionValue="value"
                         from="${['专科':'专科','本科':'本科','硕士':'硕士','博士':'博士','其他':'其他']}"
                         name='degree' value="${userBaseinfoInstance?.degree}" >
               </g:select>
</div>

<div class="fieldcontain ${hasErrors(bean: userBaseinfoInstance, field: 'majorName', 'error')} ">
	<label for="majorName">
		<g:message code="userBaseinfo.majorName.label" default="Major Name" />
		
	</label>
	<g:textField name="majorName" value="${userBaseinfoInstance?.majorName}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: userBaseinfoInstance, field: 'majorDscp', 'error')} ">
	<label for="majorDscp">
		<g:message code="userBaseinfo.majorDscp.label" default="Major Dscp" />
		
	</label>
	<g:textArea name="majorDscp" value="${userBaseinfoInstance?.majorDscp}"/>
</div>
        
          
         
          <fieldset class="buttons">
					<g:actionSubmit class="gh_button" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" />
                                        <!--
					<g:actionSubmit class="gh_button icon danger" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" formnovalidate="" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" />
                                           -->
                                        </fieldset>
          
          
         
        </div>
               </div>
                <!-- 最高学历结束 -->
                 <!-- 工作履历开始 -->
                                <div id="tabs-3">
                                  
                                  
                                  
                                   <div class="box_c">
            <table><tbody>
              <thead>
                <tr>
                  <td>开始时间</td>
                  <td>结束时间</td>
                  <td>公司名称</td>
                  <td>职位信息</td>
                  <td>操作</td>
                </tr>
              <g:each in="${userResumes?}" var="q" status="i">


                <tr title="${q.jobDscp}" class="${(i % 2) == 0 ? 'even' : 'odd'}">

                  <td>${q.beginYear}/${q.beginMonth}</td>
                 <td>${q.endYear}/${q.endMonth}</td>

                  <td>${q.companyName}</td>

                  <td>${q.jobTitle}</td>
                <td>
                <g:link controller="UserResume"  action="edit"  id="${q.id}">${message(code: 'default.button.edit.label', default: 'edit')}</g:link>
                <g:link controller="UserResume"  action="delete" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');"  id="${q.id}">${message(code: 'default.button.delete.label', default: 'delete')}</g:link>
              </td>

                </tr>
              </g:each>
              </tbody>
            </table>
           
             
           
            
             </div> <g:link controller="userResume" class="gh_button icon add"  action="create" params="['userBaseinfo.id': userBaseinfoInstance?.id]">新建履历</g:link>
          
        </div>
                <!-- 工作履历结束 -->
                 <!-- 附件开始 -->
                                <div id="tabs-4">
                                  
                                  
                                  
                                       
                                   <div class="box_c">
            <table><tbody>
              <thead>
                <tr>
                  <td>附件名称</td>
                  
                  <td>操作</td>
                </tr>
              <g:each in="${userAttachs?}" var="q" status="i">


                <tr title="${q.fileDscp}" class="${(i % 2) == 0 ? 'even' : 'odd'}">

                  <td>${q.fileName}</td>
              

                  <td><a class="gh_button" target="_blank" href="${createLink(uri: '/')}${q.fileUrl}">下载</a>
               <g:link controller="UserResume"  class="gh_button" action="delete" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');"  id="${q.id}">${message(code: 'default.button.delete.label', default: 'delete')}</g:link>
              </td>

                </tr>
              </g:each>
              </tbody>
            </table>
           
             
           
            
             </div> <g:link controller="userAttach" class="gh_button icon add"  action="create" params="['userBaseinfo.id': userBaseinfoInstance?.id]">新建附件</g:link>
          
       
          
        </div>
                <!-- 附件结束 -->
                
        </div>
       
             </g:form>
        
        
        
        
      </div>
    </div>
		</div>
	</body>
      

</html>
